package com.bwie.controller;

import com.bwie.common.domain.User;
import com.bwie.common.domain.response.UserResponse;
import com.bwie.common.result.Result;
import com.bwie.service.AuthService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: AuthController
 * @Description: TODO
 * @version: v1.８.0
 * @author: 房新路
 * @date: 2025/8/4 10:28
 */
@RestController
public class AuthController {
    @Autowired
    private AuthService authService;

    /**
     * 登录
     * @param user
     * @return
     */
    @PostMapping("login")
    public Result<UserResponse> login(@RequestBody User user){
        UserResponse data=authService.login(user);
        return Result.success(data);
    }

}